#ifndef MYAPPLICATION_H
#define MYAPPLICATION_H

#include <QWidget>
#include <windows.h>
#include <QApplication>
#include <dbt.h>
#include <stdio.h>
#include <QStringList>
#include <QVariant>

#ifdef UNICODE
    #define TCHAR2QString(x) QString::fromUtf16((ushort*)(x))
    #define QString2TCHAR(x) reinterpret_cast<const wchar_t *>((x).utf16())
#else
    #define TCHAR2QString(x) QString::fromUtf16((ushort*)(x))
    #define QString2TCHAR(x) (x).constData();
 #endif

class MyApplication : public QApplication
{
    Q_OBJECT
public:
    MyApplication(int ,char **);
    ~MyApplication();
    void getInsertedUSBDevices();
protected:
    bool winEventFilter(MSG *, long *);

private:
    char FirstDriveFromMask (ULONG unitmask);
    void getDiskInfo(QString disk);
    QString getDiskName(QString disk);
    QString getDiskVolume(QString disk);
    QString getDiskFileSystem(QString disk);

signals:
    void usbDiskInserted(QVariant disk, QVariant label, QVariant volume, QVariant fileSystem);
    void usbDiskRemoved(QVariant disk);

};

#endif // MYAPPLICATION_H
